﻿namespace Smart.Utils.UI
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Windows.Forms.Design;

    [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
    public class LoadingCircleToolStripMenuItem : ToolStripControlHost
    {
        public LoadingCircleToolStripMenuItem() : base(new LoadingCircle())
        {
        }

        public override Size GetPreferredSize(Size constrainingSize)
        {
            return this.LoadingCircleControl.GetPreferredSize(constrainingSize);
        }

        protected override void OnSubscribeControlEvents(Control control)
        {
            base.OnSubscribeControlEvents(control);
        }

        protected override void OnUnsubscribeControlEvents(Control control)
        {
            base.OnUnsubscribeControlEvents(control);
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content), RefreshProperties(RefreshProperties.All)]
        public LoadingCircle LoadingCircleControl
        {
            get
            {
                return (base.Control as LoadingCircle);
            }
        }
    }
}

